<script setup lang="ts">
import {computed, ref} from "vue";
import useParcel from "@/utils/crud/useParcel";
import parcel from "@/api/document/parcel";
const record = ref({})
const visible = defineModel()
const options = computed(()=> {
  return {
    showTools:false,
    api: parcel.getAllList,
    requestParams: {
      shipment_id: record.value.id,
    }
  }
})
const open = (r)=>{
  record.value = r
  visible.value = true
}
defineExpose({
  open
})
</script>

<template>
  <a-drawer width="70%" :visible="visible" @cancel="visible = false"
            @ok="visible=false" v-if="visible"
            :title="record.shipment_no"
            :footer="false">
    <ma-crud :columns="useParcel.columns" :options="options"/>
  </a-drawer>
</template>

<style scoped>

</style>